00001
00009 #include "ndame.h"
00010
00025 int attack(struct data*d1,int ii,int ik)
00026 {
00027 int irow;
00028 int icol;
00029
00030 irow=ii;
00031 icol=ik;
00032
00033 for(irow;irow>=0;irow--)
00034 {
00035 if(d1->iboard[irow][icol])
00036 {
00037 return 1;
00038 }
00039 }
00040 irow=ii;
00041
00042 while((irow>=0)&&(icol>=0))
00043 {
00044 if(d1->iboard[irow][icol])
00045 {
00046 return 1;
00047 }
00048
00049 irow--;
00050 icol--;
00051 }
00052 irow=ii;
00053 icol=ik;
00054
00055 while((irow>=0)&&(icol<d1->iblength))
00056 {
00057 if(d1->iboard[irow][icol])
00058 {
00059 return 1;
00060 }
00061
00062 irow--;
00063 icol++;
00064 }
00065
00066 return 0;
00067 }